import Vue from 'vue'
import VueRouter, {RouteConfig} from 'vue-router'
import Home from '../views/Home.vue'
import List from '../views/List.vue'
import Add from '../views/Add.vue'
import Q from '../views/Q.vue'
import Map from '../views/Map1.vue'
import Map2 from '../views/Map2.vue'
import Map3 from '../views/Map3.vue'

Vue.use(VueRouter)

const routes: Array<RouteConfig> = [
    {
        path: '/',
        name: 'q',
        component: Q
    }, {
        path: '/map1',
        name: 'map1',
        component: Map
    }, {
        path: '/map2',
        name: 'map2',
        component: Map2
    }, {
        path: '/map3',
        name: 'map3',
        component: Map3
    },
    {
        path: '/about',
        name: 'About',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
    }
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
